home *** CD-ROM | disk | FTP | other *** search
- Path: dziuxsolim.rutgers.edu!usenet
- From: Jordan Charney <jordanc@eden.rutgers.edu>
- Newsgroups: comp.lang.c
- Subject: Linked List Problem from a Beginner
- Date: Mon, 12 Feb 1996 14:56:34 -0500
- Organization: Rutgers University
- Message-ID: <311F9B72.12E4@eden.rutgers.edu>
- NNTP-Posting-Host: calloway-asy-13.rutgers.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-poster: jordanc
- X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
-
- I am trying to write a program that involves linked lists. It is supposed to be able to initialize,
- rename, destroy, add to the end, insert, move through the list, delete and display. I am having some
- trouble creating the correct code for it.
- The list has the following structure:
- typedef struct _listnode
- { void *data;
- struct _listnode *next;
- } *listnode;
-
- typedef struct _list
- {listnode head, tail current;
- int length;
- void *label;
- } *list
-
-
- I am having trouble adding a node to the end of the list because I can't figure out how to move
- the tail pointer and still keep that value in the list without losing the pointer to it.
- I also can't quite get the insert and the delete because i'm not sure how to write the code to
- change what the previous entry is pointing to.
- Any help is greatly appreciated
- --
-
- -Jordan
- jordanc@eden.rutgers.edu
- http://www.eden.rutgers.edu/~jordanc
- **********************************************************************************************
-